package bbs.service.impl;

import bbs.entity.dto.FollowDto;
import bbs.entity.po.Follow;
import bbs.mappers.FollowMapper;
import bbs.service.FollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("followServiceImpl")
public class FollowServiceImpl implements FollowService {

    @Autowired
    private FollowMapper followMapper;

    @Override
    public void addFollow(String userId, String followId) {
        followMapper.addFollow(userId, followId);
    }

    @Override
    public void cancelFollow(String followId) {
        followMapper.cancelFollow(followId);
    }

    @Override
    public Integer FollowFlag(String userId, String followId) {
        return followMapper.followFlag(userId, followId) > 0 ? 1 : 0;
    }

    @Override
    public List<Follow> FollowList(String followId) {
        return followMapper.followList(followId);
    }

    @Override
    public List<FollowDto> UserList(String userId) {
        return followMapper.userList(userId);
    }
}
